package com.klun.hdfs.hd.reducer;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class TwoIndexReducer extends Reducer<Text,Text,Text,Text> {

    @Override
    protected void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        // atguigu a.txt 3

        StringBuilder v = new StringBuilder();
        for (Text t : values) {
            v.append(t.toString().replace("\t","-->")+"\t");
        }
        context.write(key,new Text(v.toString()));

    }
}
